package sync.hw.teacher.demo02;

import org.junit.jupiter.api.Test;

/**
 * @author lwj
 * @date 2025-03-13
 * @vesion 1.0.0
 */
public class MainTest {
    public static void main(String[] args) {
        Printer hp = new Printer();

        // 1.实例化 Runnable 对象
        MyRunnable mr1 = new MyRunnable(hp,"李林","我喜欢玩原神！");
        MyRunnable mr2 = new MyRunnable(hp,"老龚","我喜欢玩暗区！");

        // 2.实例化 Thread 对象
        Thread t1 = new Thread(mr1);
        Thread t2 = new Thread(mr2);

        // 3.启动线程
        t1.start();
        t2.start();
    }
}
